from django.apps import AppConfig
from django.contrib.auth.models import User
from django.db import models


# Create your models here.
class Exercise(models.Model):
    TYPE_CHOICES = (
        ('单项选择题', '单项选择题'),
        ('多项选择题', '多项选择题'),
        ('填空题', '填空题'),
    )
    e_type = models.CharField('题目类型', max_length=10, choices=TYPE_CHOICES)
    content = models.TextField('题目内容')
    answer = models.CharField('标准答案', max_length=50)
    creator = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, verbose_name='上传者')

    class Meta:
        verbose_name = "练习题"
        verbose_name_plural = "题库"

